﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace RotovapPlatform.Infrastructure.Common.Data.Migrations.Storage
{
    /// <inheritdoc />
    public partial class InitialCreate : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "StorageLocations",
                columns: table => new
                {
                    Id = table.Column<int>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    LocationCode = table.Column<int>(type: "INTEGER", nullable: false),
                    Position = table.Column<int>(type: "INTEGER", nullable: false),
                    IsOccupied = table.Column<bool>(type: "INTEGER", nullable: false),
                    IsReserved = table.Column<int>(type: "INTEGER", nullable: false),
                    SupportedItemTypes = table.Column<string>(type: "TEXT", nullable: false),
                    CurrentItem = table.Column<string>(type: "TEXT", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StorageLocations", x => x.Id);
                });

            migrationBuilder.CreateIndex(
                name: "IX_StorageLocations_LocationCode_Position",
                table: "StorageLocations",
                columns: new[] { "LocationCode", "Position" },
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "StorageLocations");
        }
    }
}
